import unittest
from Day19.Tools import Tools
from XTestRunner import HTMLTestRunner
if __name__ == '__main__':
    #生成日志
    suite = unittest.defaultTestLoader.discover(start_dir='/', pattern='TestCase.py')
    Tools().log_info('info.txt','w+')

    #发送邮件
    with open('baogao.html', 'wb')as e:
        runner = HTMLTestRunner(stream=e,title='测试报告',language='zh-CN')

        runner.run(suite)
        Tools().send_email('测试报告', ['baogao.html', 'info.txt'])


